home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / windows / win31 / fdump102.arj / FILEDUMP.FRM < prev    next >
Text File  |  1993-10-12  |  36KB  |  1,072 lines

  1. VERSION 2.00
  2. Begin Form Form_Main 
  3.    ClientHeight    =   4860
  4.    ClientLeft      =   1140
  5.    ClientTop       =   1680
  6.    ClientWidth     =   8070
  7.    Height          =   5550
  8.    Icon            =   FILEDUMP.FRX:0000
  9.    Left            =   1080
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4860
  12.    ScaleWidth      =   8070
  13.    Top             =   1050
  14.    Width           =   8190
  15.    Begin CommandButton cbNext 
  16.       Caption         =   "Next"
  17.       Height          =   212
  18.       Left            =   6840
  19.       TabIndex        =   2
  20.       Top             =   4560
  21.       Visible         =   0   'False
  22.       Width           =   615
  23.    End
  24.    Begin CommandButton cbPrev 
  25.       Caption         =   "Prev"
  26.       Height          =   212
  27.       Left            =   600
  28.       TabIndex        =   1
  29.       Top             =   4560
  30.       Visible         =   0   'False
  31.       Width           =   615
  32.    End
  33.    Begin CommonDialog CMDialog1 
  34.       FontName        =   "Courier New"
  35.       FontSize        =   10
  36.       InitDir         =   "C:\"
  37.       Left            =   0
  38.       Top             =   4320
  39.    End
  40.    Begin ListBox GrpDetail 
  41.       FontBold        =   -1  'True
  42.       FontItalic      =   0   'False
  43.       FontName        =   "Courier New"
  44.       FontSize        =   8.25
  45.       FontStrikethru  =   0   'False
  46.       FontUnderline   =   0   'False
  47.       Height          =   3600
  48.       Left            =   0
  49.       TabIndex        =   0
  50.       TabStop         =   0   'False
  51.       Top             =   0
  52.       Width           =   8055
  53.    End
  54.    Begin Label lblFileSize 
  55.       Alignment       =   2  'Center
  56.       Height          =   210
  57.       Left            =   1440
  58.       TabIndex        =   3
  59.       Top             =   4560
  60.       Width           =   5175
  61.    End
  62.    Begin Menu M_File 
  63.       Caption         =   "&File"
  64.       Begin Menu M_FileOpen 
  65.          Caption         =   "&Open"
  66.       End
  67.       Begin Menu M_FilePrint 
  68.          Caption         =   "&Print"
  69.       End
  70.       Begin Menu M_FileBar1 
  71.          Caption         =   "-"
  72.       End
  73.       Begin Menu M_FileExit 
  74.          Caption         =   "E&xit"
  75.       End
  76.    End
  77.    Begin Menu M_Help 
  78.       Caption         =   "&Help"
  79.       Begin Menu M_HelpAbout 
  80.          Caption         =   "&About"
  81.       End
  82.    End
  83. End
  84. Option Explicit
  85. '
  86. '--------------------------------------------------------
  87. ' Module Level Globals
  88. '--------------------------------------------------------
  89. Dim imPixelsPerChar As Integer
  90. Dim fmForm_MainTopDefault As Single
  91. Dim smSourceFileName As String
  92. Dim imMaxRecord As Integer
  93. Dim imPriorShow As Integer
  94. '
  95. Dim imBlockStarts(50) As Integer
  96. Dim imBlockNumber As Integer
  97. '
  98. Const ICON_TWIPS = 540
  99. Const MIN_WIDTH = 8070
  100. Const MIN_HEIGHT = 4650
  101. Const BLOCK_SIZE = 4096
  102. '
  103.  
  104. '--------------------------------------------------------
  105. '--------------------------------------------------------
  106. Sub cbNext_Click ()
  107.   '
  108.   Dim sBuffer As String
  109.   Dim iEndOfFileFlag As Integer
  110.   '
  111.   ' Update BlockStarts Vector Pointer
  112.   If imBlockStarts(imBlockNumber + 1) > imBlockStarts(imBlockNumber) Then
  113.     imBlockNumber = imBlockNumber + 1
  114.   End If
  115.   '
  116.   cbNext.Visible = False
  117.   cbPrev.Visible = False
  118.   '
  119.   iEndOfFileFlag = False
  120.   GrpDetail.Clear
  121.   Form_Main.MousePointer = HOURGLASS
  122.   Call ReadBack(sgWorkFileName, imBlockStarts(imBlockNumber), imMaxRecord, iEndOfFileFlag, sBuffer)
  123.   Form_Main.MousePointer = DEFAULT
  124.     Debug.Print "cbNext_Click: ";
  125.     Debug.Print "imBlockStarts("; imBlockNumber; ")=";
  126.     Debug.Print imBlockStarts(imBlockNumber)
  127.   '
  128.   ' Update BlockStarts Vector
  129.   If imBlockStarts(imBlockNumber + 1) <= imBlockStarts(imBlockNumber) Then
  130.     imBlockStarts(imBlockNumber + 1) = imBlockStarts(imBlockNumber) + GrpDetail.ListCount
  131.       Debug.Print "cbNext_Click: GrpDetail.ListCount=";
  132.       Debug.Print GrpDetail.ListCount;
  133.       Debug.Print " imMaxRecord="; imMaxRecord;
  134.       Debug.Print "  imBlockStarts("; imBlockNumber + 1; ")=";
  135.       Debug.Print imBlockStarts(imBlockNumber + 1)
  136.   End If
  137.   '
  138.   '
  139.   If imBlockNumber > 1 Then
  140.     cbPrev.Visible = True
  141.   End If
  142.   '
  143.   If imBlockStarts(imBlockNumber + 1) < imMaxRecord Then
  144.     cbNext.Visible = True
  145.   End If
  146.  
  147. End Sub
  148.  
  149. '--------------------------------------------------------
  150. '--------------------------------------------------------
  151. Sub cbPrev_Click ()
  152.   '
  153.   Dim sBuffer As String
  154.   Dim iEndOfFileFlag As Integer
  155.   '
  156.   ' Update BlockStarts Vector Pointer
  157.   imBlockNumber = imBlockNumber - 1
  158.   '
  159.   cbNext.Visible = False
  160.   cbPrev.Visible = False
  161.   '
  162.   iEndOfFileFlag = False
  163.   GrpDetail.Clear
  164.   Form_Main.MousePointer = HOURGLASS
  165.   Call ReadBack(sgWorkFileName, imBlockStarts(imBlockNumber), imMaxRecord, iEndOfFileFlag, sBuffer)
  166.   Form_Main.MousePointer = DEFAULT
  167.     Debug.Print "cbPrev_Click: ";
  168.     Debug.Print "imBlockStarts("; imBlockNumber; ")=";
  169.     Debug.Print imBlockStarts(imBlockNumber)
  170.   '
  171.     Debug.Print "cbPrev_Click: GrpDetail.ListCount=";
  172.     Debug.Print GrpDetail.ListCount;
  173.     Debug.Print " imMaxRecord="; imMaxRecord;
  174.     Debug.Print "  imBlockStarts("; imBlockNumber + 1; ")=";
  175.     Debug.Print imBlockStarts(imBlockNumber + 1)
  176.   '
  177.   '
  178.   If imBlockNumber > 1 Then
  179.     cbPrev.Visible = True
  180.   End If
  181.   '
  182.   If imBlockStarts(imBlockNumber) < imMaxRecord Then
  183.     cbNext.Visible = True
  184.   End If
  185.  
  186. End Sub
  187.  
  188. '---------------------------------------------------------
  189. ' Process Form_Load Event
  190. '---------------------------------------------------------
  191. Sub Form_Load ()
  192.   '
  193.   '' Set Global Program ID Values
  194.   sgProgramName = App.EXEName               'Set Program Name
  195.   sgRegistrationStatus = "Un-Registered Shareware"
  196.   sgProgramVersion = "1.02"
  197.   sgCompuserveID = "71055,1043"
  198.   '
  199. '  Debug.Print "CurDir$="; CurDir$
  200. '  Debug.Print "App.Path="; App.Path
  201.   If Right(App.Path, 1) <> "\" Then
  202.     sgWorkFileName = App.Path & "\FILEDUMP.TMP"
  203.   Else
  204.     sgWorkFileName = App.Path & "FILEDUMP.TMP"
  205.   End If
  206. '  Debug.Print "sgWorkFileName="; sgWorkFileName
  207.   '
  208. '  fmForm_MainTopDefault = 10               'Set Production Top
  209.   fmForm_MainTopDefault = 1065              'Set Debugging Top
  210.   imPixelsPerChar = 8
  211.   '
  212.   GrpDetail.Height = 4230                   'Force Height
  213.   '
  214.   Form_Main.Caption = sgProgramName & " " & sgProgramVersion
  215.   '
  216.   '' Insure only one instance is running
  217.   If App.PrevInstance Then
  218.     MsgBox App.EXEName & " is already running!" & Chr$(10) & "  Second instance has been cancelled.", MB_ICONEXCLAMATION
  219.     End
  220.   End If
  221.   '
  222.   '' Set Default Screen Sizing Values
  223.   Form_Main.ScaleMode = TWIPS
  224.   '
  225.   fgCurrentHeightFactor = 1
  226.   fgCurrentWidthFactor = 1
  227.   '
  228.   fgBaseFormLeft = Form_Main.Left
  229.   fgBaseFormTop = Form_Main.Top
  230.   fgBaseFormWidth = Form_Main.Width
  231.   fgBaseFormHeight = Form_Main.Height
  232. '    Debug.Print "Form_Load Base: "; fgBaseFormLeft; fgBaseFormTop; fgBaseFormWidth; fgBaseFormHeight
  233. '    Printer.Print Tab(25); " Left"; Tab(33); "Top"; Tab(40); "Width"; Tab(47); "Height"
  234. '    Printer.Print "Form_Load Base: "; Tab(25); fgBaseFormLeft; Tab(33); fgBaseFormTop; Tab(40); fgBaseFormWidth; Tab(47); fgBaseFormHeight
  235. '    Printer.Print "          GrpDetail: "; Tab(25); GrpDetail.Left; Tab(33); GrpDetail.Top; Tab(40); GrpDetail.Width; Tab(47); GrpDetail.Height
  236. '    Printer.Print "          cbPrev:"; Tab(25); cbPrev.Left; Tab(33); cbPrev.Top; Tab(40); cbPrev.Width; Tab(47); cbPrev.Height
  237. '    Printer.Print "          cbNext:"; Tab(25); cbNext.Left; Tab(33); cbNext.Top; Tab(40); cbNext.Width; Tab(47); cbNext.Height
  238. '    Printer.Print "          lblFileSize:"; Tab(25); lblFileSize.Left; Tab(33); lblFileSize.Top; Tab(40); lblFileSize.Width; Tab(47); lblFileSize.Height
  239.   '
  240.   '' Make sure Form will fit the Screen Size
  241.   If fgBaseFormLeft + fgBaseFormWidth > Screen.Width Then
  242.     MsgBox "The program calls for Higher Horizontal Resolution." & Chr$(10) & " -- The Default Maximum will be used.", MB_ICONEXCLAMATION
  243.     fgBaseFormLeft = 10
  244.     fgBaseFormWidth = Screen.Width - fgBaseFormLeft
  245.   End If
  246.   '
  247.   If fgBaseFormTop + fgBaseFormHeight > Screen.Height Then
  248.     MsgBox "The program calls for Higher Vertical Resolution." & Chr$(10) & " -- The Default Maximum will be used.", MB_ICONEXCLAMATION
  249.     fgBaseFormTop = fmForm_MainTopDefault
  250.     fgBaseFormHeight = Screen.Height - fgBaseFormTop
  251.   End If
  252.   '
  253.     'TRIGGERS Form_Resize EVENT, if different
  254.   Form_Main.Move fgBaseFormLeft, fgBaseFormTop, fgBaseFormWidth, fgBaseFormHeight
  255.   '
  256.   Call Load_Private_Profile
  257.   '
  258.   '' Display Commercial Form Asynchronously
  259.   igFromForm = 1
  260.     'TRIGGERS Form xWare Form_Load EVENT
  261.   Form_xWare.Enabled = True
  262.   Form_Main.Visible = False
  263.   Form_xWare.Visible = True
  264.  
  265. End Sub
  266.  
  267. '---------------------------------------------------------
  268. ' Process Form_Resize Event
  269. '---------------------------------------------------------
  270. Sub Form_Resize ()
  271.   '
  272.   Form_Main.ScaleMode = TWIPS
  273.   '
  274. '  Debug.Print "ScaleWidth="; ScaleWidth; " Screen.Width="; Screen.Width; "ScaleHeight="; ScaleHeight; " Screen.Height="; Screen.Height
  275.   '
  276.   '' If not Iconized, insure sizing greater then Minimum Useable Form Size
  277.   If (ScaleWidth > ICON_TWIPS And ScaleWidth < MIN_WIDTH) Or (ScaleHeight > ICON_TWIPS And ScaleHeight < MIN_HEIGHT) Then
  278.       Debug.Print "("; ScaleWidth; ">"; ICON_TWIPS; "&"; ScaleWidth; "<"; MIN_WIDTH; ") or ("; ScaleHeight; ">"; ICON_TWIPS; "&"; ScaleHeight; "<"; MIN_HEIGHT; ")"
  279.       'TRIGGERS Form_Resize EVENT
  280.     Form_Main.Move fgBaseFormLeft, fgBaseFormTop, fgBaseFormWidth, fgBaseFormHeight
  281.     Form_Main.Refresh
  282.   End If
  283.   '
  284.   '' If not 1st Form_Resize, Calculate new ratio
  285.   If fgCurrentFormWidth <> 0 Then
  286.     ' Calculate Width Change Ratio
  287.     If ScaleWidth <> fgCurrentFormWidth And ScaleWidth <> ICON_TWIPS And fgCurrentFormWidth <> 0 Then
  288.       fgCurrentWidthFactor = Form_Main.Width / fgCurrentFormWidth
  289.     Else
  290.       fgCurrentWidthFactor = 1
  291.     End If
  292.     ' Calculate Heigth Change Ratio
  293.     If ScaleHeight <> fgCurrentFormHeight And ScaleHeight <> ICON_TWIPS And fgCurrentFormHeight <> 0 Then
  294.       fgCurrentHeightFactor = Form_Main.Height / fgCurrentFormHeight
  295.     Else
  296.       fgCurrentHeightFactor = 1
  297.     End If
  298.   End If
  299.   '
  300.   '' Apply Form Change Ratio to ALL Form Controls
  301.   If fgCurrentHeightFactor <> 1 Or fgCurrentWidthFactor <> 1 Then
  302.     GrpDetail.Move GrpDetail.Left * fgCurrentWidthFactor, GrpDetail.Top * fgCurrentHeightFactor, GrpDetail.Width * fgCurrentWidthFactor, GrpDetail.Height * fgCurrentHeightFactor
  303.     cbPrev.Move cbPrev.Left * fgCurrentWidthFactor, cbPrev.Top * fgCurrentHeightFactor, cbPrev.Width * fgCurrentWidthFactor, cbPrev.Height * fgCurrentHeightFactor
  304.     cbNext.Move cbNext.Left * fgCurrentWidthFactor, cbNext.Top * fgCurrentHeightFactor, cbNext.Width * fgCurrentWidthFactor, cbNext.Height * fgCurrentHeightFactor
  305.     lblFileSize.Move lblFileSize.Left * fgCurrentWidthFactor, lblFileSize.Top * fgCurrentHeightFactor, lblFileSize.Width * fgCurrentWidthFactor, lblFileSize.Height * fgCurrentHeightFactor
  306.   End If
  307.   '
  308.   '' If not Iconized, Save Current Form Size
  309.   If ScaleWidth <> ICON_TWIPS And ScaleHeight <> ICON_TWIPS Then
  310.     fgCurrentFormLeft = Form_Main.Left
  311.     fgCurrentFormTop = Form_Main.Top
  312.     fgCurrentFormWidth = Form_Main.Width
  313.     fgCurrentFormHeight = Form_Main.Height
  314. '      Printer.Print Tab(25); " Left"; Tab(33); "Top"; Tab(40); "Width"; Tab(47); "Height"
  315. '      Printer.Print "Form_Resize Current: "; Tab(25); fgCurrentFormLeft; Tab(33); fgCurrentFormTop; Tab(40); fgCurrentFormWidth; Tab(47); fgCurrentFormHeight
  316. '      Printer.Print "            GrpDetail: "; Tab(25); GrpDetail.Left; Tab(33); GrpDetail.Top; Tab(40); GrpDetail.Width; Tab(47); GrpDetail.Height
  317. '      Printer.Print "            cbPrev:"; Tab(25); cbPrev.Left; Tab(33); cbPrev.Top; Tab(40); cbPrev.Width; Tab(47); cbPrev.Height
  318. '      Printer.Print "            cbNext:"; Tab(25); cbNext.Left; Tab(33); cbNext.Top; Tab(40); cbNext.Width; Tab(47); cbNext.Height
  319. '      Printer.Print "            lblFileSize:"; Tab(25); lblFileSize.Left; Tab(33); lblFileSize.Top; Tab(40); lblFileSize.Width; Tab(47); lblFileSize.Height
  320.   End If
  321.   '
  322.   Form_Main.Refresh
  323.  
  324. End Sub
  325.  
  326. '---------------------------------------------------------
  327. ' Process Form_Unload Event
  328. '---------------------------------------------------------
  329. Sub Form_Unload (Cancel As Integer)
  330.   '
  331.   igFromForm = 3
  332.   Form_Main.Enabled = False
  333.   Form_Main.Visible = False
  334.   On Error GoTo FormUnloadError
  335.   Kill sgWorkFileName
  336.   Unload Form_Main
  337.   '
  338.   Form_xWare.Enabled = True
  339.   Form_xWare.Visible = True
  340.   Exit Sub
  341. '
  342. '
  343. FormUnloadError:
  344.   '
  345.   igErrorNumber = Err
  346.   '
  347.   If Err = 53 Then
  348.     ' No Temp File to Kill
  349.     Resume Next
  350.   End If
  351.   '
  352.   Select Case Err
  353.     Case 0: Exit Sub
  354.     Case 5: sgErrorMessage = "ERROR 5: Illegal Function Call"
  355.     Case 7: sgErrorMessage = "ERROR 7: Out of Memory"
  356.     Case 53: sgErrorMessage = "ERROR 53: That file doesn't exist."
  357.     Case 62: sgErrorMessage = "ERROR 62: Attempt to Input past End-of-File."
  358.     Case 68: sgErrorMessage = "ERROR 68: Drive " & Left$(smSourceFileName, 1) & ": not available."
  359.     Case 76: sgErrorMessage = "ERROR 76: That path doesn't exist."
  360.     Case Else: sgErrorMessage = "ERROR " & Err & " occurred." & "  " & Error$(Err)
  361.   End Select
  362.   MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - Form_Unload"
  363.   Resume Next
  364.   '
  365.  
  366. End Sub
  367.  
  368. '--------------------------------------------------------
  369. ' Load Private Profile Values
  370. '
  371. '   Uses: sgWindowsDirectory, sgProgramName,
  372. '         sgGroupsDrive, sgGroupsPath, fgBaseFormLeft,
  373. '         fgBaseFormTop, fgBaseFormWidth, fgBaseFormHeight,
  374. '         fgCurrentWidthFactor, fgCurrentHeightFactor
  375. '
  376. '   Sets: sgWindowsDirectory, GrpDrive.Drive, GrpDir.Path,
  377. '         sgGroupsDrive, sgGroupsPath, fgCurrentWidthFactor,
  378. '         fgCurrentHeightFactor
  379. '
  380. '--------------------------------------------------------
  381. Sub Load_Private_Profile ()
  382.   '
  383.   Dim sIniFile As String
  384.   Dim sIniString As String * 150
  385.   Static fFormSZ(4) As Single
  386.   '
  387.   '' Set .INI File Path value
  388.   sgWindowsDirectory = sGetWindowsDir()
  389.   sIniFile = sgWindowsDirectory & sgProgramName & ".INI"
  390.   '
  391.   '' Load .INI Values
  392.   ' Get 'Window/Left'
  393.   Call GetPProfileString("Window", "Left", "ERROR", sIniFile, sIniString, Len(sIniString))
  394.   If Left$(sIniString, 5) = "ERROR" Then
  395.     '' Process 'Source/Path' Error
  396.     '' Set Default Profile Values, if no .INI 'Path'
  397.     '
  398.     fFormSZ(0) = fgBaseFormLeft
  399.     fFormSZ(1) = fgBaseFormTop
  400.     fFormSZ(2) = fgBaseFormWidth
  401.     fFormSZ(3) = fgBaseFormHeight
  402.   Else
  403.     '
  404.     fFormSZ(0) = Val(sIniString)
  405.     '
  406.     ' Get 'Window/Top'
  407.     Call GetPProfileString("Window", "Top", "ERROR", sIniFile, sIniString, Len(sIniString))
  408.     If Left$(sIniString, 5) = "ERROR" Then
  409.       fFormSZ(1) = fgBaseFormTop
  410.     Else
  411.       fFormSZ(1) = Val(sIniString)
  412.     End If
  413.     '
  414.     ' Get 'Window/Width'
  415.     Call GetPProfileString("Window", "Width", "ERROR", sIniFile, sIniString, Len(sIniString))
  416.     If Left$(sIniString, 5) = "ERROR" Then
  417.       fFormSZ(2) = fgBaseFormWidth
  418.     Else
  419.       fFormSZ(2) = Val(sIniString)
  420.     End If
  421.     '
  422.     ' Get 'Window/Height'
  423.     Call GetPProfileString("Window", "Height", "ERROR", sIniFile, sIniString, Len(sIniString))
  424.     If Left$(sIniString, 5) = "ERROR" Then
  425.       fFormSZ(3) = fgBaseFormHeight
  426.     Else
  427.       fFormSZ(3) = Val(sIniString)
  428.     End If
  429.     '
  430.     '' Make sure Form will fit the Profile Screen Size
  431.     If fFormSZ(0) + fFormSZ(2) > Screen.Width Then
  432.       MsgBox "The current profile calls for Higher Horizontal Resolution." & Chr$(10) & " -- The Default Maximum will be used."
  433.       fFormSZ(0) = 10
  434.       fFormSZ(2) = Screen.Width - fFormSZ(0)
  435.     End If
  436.     If fFormSZ(1) + fFormSZ(3) > Screen.Height Then
  437.       MsgBox "The current profile calls for Higher Vertical Resolution." & Chr$(10) & " -- The Default Maximum will be used."
  438.       fFormSZ(1) = fmForm_MainTopDefault
  439.       fFormSZ(3) = Screen.Height - fFormSZ(1)
  440.     End If
  441.     '
  442.     '' Calculate Resize Coefficients for Profile Values
  443.     fgCurrentWidthFactor = fFormSZ(2) / fgBaseFormWidth
  444.     fgCurrentHeightFactor = fFormSZ(3) / fgBaseFormHeight
  445.     '
  446.     '' Resize Screen Based on Profile Values
  447.       'TRIGGERS Form_Resize EVENT
  448.     Form_Main.Move fFormSZ(0), fFormSZ(1), fFormSZ(2), fFormSZ(3)
  449.     '
  450.   End If
  451.  
  452. End Sub
  453.  
  454. '---------------------------------------------------------
  455. ' Process Menu 'File/Exit' Selection Event
  456. '---------------------------------------------------------
  457. Sub M_FileExit_Click ()
  458.   '
  459.   Call Save_Private_Profile
  460.   '
  461.   igFromForm = 3
  462.   Form_Main.Enabled = False
  463.   Form_Main.Visible = False
  464.   On Error GoTo FileExitError
  465.   Unload Form_Main
  466.   '
  467.   Form_xWare.Enabled = True
  468.   Form_xWare.Visible = True
  469.   Exit Sub
  470. '
  471. '
  472. FileExitError:
  473.   '
  474.   igErrorNumber = Err
  475.   '
  476.   Select Case Err
  477.     Case 0: Exit Sub
  478.     Case 5: sgErrorMessage = "ERROR 5: Illegal Function Call"
  479.     Case 7: sgErrorMessage = "ERROR 7: Out of Memory"
  480.     Case 53: sgErrorMessage = "ERROR 53: That file doesn't exist."
  481.     Case 62: sgErrorMessage = "ERROR 62: Attempt to Input past End-of-File."
  482.     Case 68: sgErrorMessage = "ERROR 68: Drive " & Left$(smSourceFileName, 1) & ": not available."
  483.     Case 76: sgErrorMessage = "ERROR 76: That path doesn't exist."
  484.     Case Else: sgErrorMessage = "ERROR " & Err & " occurred." & "  " & Error$(Err)
  485.   End Select
  486.   MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - M_FileExit"
  487.   Resume Next
  488.  
  489. End Sub
  490.  
  491. '--------------------------------------------------------
  492. '--------------------------------------------------------
  493. Sub M_FileOpen_Click ()
  494.   '
  495.   Dim lBlockOffset As Long
  496.   Dim iEndOfFileFlag As Integer
  497.   Dim sBuffer As String
  498.   Dim lFileSize As Long
  499.   Dim iStartRecord As Integer
  500.   '
  501.   ' Specify Input File via Windows API
  502.   On Error GoTo FileOpenError
  503.   '
  504.   CMDialog1.Flags = OFN_FILEMUSTEXIST Or OFN_PATHMUSTEXIST Or OFN_HIDEREADONLY
  505.   CMDialog1.DialogTitle = sgProgramName & " Open File to Dump"
  506.   CMDialog1.InitDir = "C:\"
  507.   CMDialog1.CancelError = True
  508.   CMDialog1.Filter = "Any(*.*)|*.*"
  509.     ''TRIGGERS Open File Dialog
  510.   CMDialog1.Action = DLG_FILE_OPEN
  511.   '
  512.   ' Save Input File Name
  513.   smSourceFileName = CMDialog1.Filename
  514.   '
  515.   ' If not error or Cancel, insert Input File Name in
  516.   '  Window Caption
  517.   If igErrorNumber = 0 Then
  518.     Form_Main.Caption = sgProgramName & " " & sgProgramVersion & " -- " & smSourceFileName
  519.   Else
  520.     igErrorNumber = 0
  521.     Exit Sub
  522.   End If
  523.   '
  524.   On Error GoTo 0
  525.   '
  526.   If Len(smSourceFileName) Then
  527.     If Len(Dir$(smSourceFileName)) Then
  528.       '
  529.       ' Display File Size in Label
  530.       lFileSize = FileLen(smSourceFileName)
  531.       lblFileSize = Format$(lFileSize, "###,###,##0") & " == " & Hex(lFileSize - 1)
  532.       Form_Main.Refresh
  533.       '
  534.       iEndOfFileFlag = False
  535.       imMaxRecord = 0
  536.       lBlockOffset = 0
  537.       '
  538.       ' Format Entire Input File into Work File
  539.       Form_Main.MousePointer = HOURGLASS
  540.       '
  541.       While iEndOfFileFlag = False And igErrorNumber = 0
  542.         Call ReadBlock(smSourceFileName, lFileSize, iEndOfFileFlag, lBlockOffset, sBuffer)
  543.         Call WorkBlock(sgWorkFileName, lBlockOffset, sBuffer)
  544.         lBlockOffset = lBlockOffset + BLOCK_SIZE
  545.       Wend
  546.       '
  547.       Form_Main.MousePointer = DEFAULT
  548.       '
  549.       '
  550.       lFileSize = FileLen(sgWorkFileName)
  551. '        Debug.Print "M_FileOpen: Work-FileLen="; Format$(lFileSize, "###,###,##0")
  552.       '
  553.       '
  554.       imBlockNumber = 1
  555.       imBlockStarts(imBlockNumber) = 0
  556.       '
  557.       imPriorShow = 0
  558.       iEndOfFileFlag = False
  559.       '
  560.       ' Display the 1st Block of Formatted Data
  561.       GrpDetail.Clear
  562.       Form_Main.MousePointer = HOURGLASS
  563.       Call ReadBack(sgWorkFileName, imBlockStarts(imBlockNumber), imMaxRecord, iEndOfFileFlag, sBuffer)
  564.       Form_Main.MousePointer = DEFAULT
  565.         Debug.Print "M_FileOpen_Click: ";
  566.         Debug.Print "imBlockStarts("; imBlockNumber; ")=";
  567.         Debug.Print imBlockStarts(imBlockNumber)
  568.       '
  569.       ' Update BlockStarts Vector
  570.       imBlockStarts(imBlockNumber + 1) = GrpDetail.ListCount
  571.         Debug.Print "M_FileOpen_Click: GrpDetail.ListCount=";
  572.         Debug.Print GrpDetail.ListCount;
  573.         Debug.Print " imMaxRecord="; imMaxRecord;
  574.         Debug.Print "  imBlockStarts("; imBlockNumber + 1; ")=";
  575.         Debug.Print imBlockStarts(imBlockNumber + 1)
  576.       '
  577.       ' Display Next Button, if appropriate
  578.       If imBlockStarts(imBlockNumber + 1) < imMaxRecord Then
  579.         cbNext.Visible = True
  580.       End If
  581.       '
  582.     End If
  583.   End If
  584.   '
  585.   If igErrorNumber Then igErrorNumber = 0
  586.   '
  587.   Exit Sub
  588. '
  589. '
  590. FileOpenError:
  591.   '
  592.   igErrorNumber = Err
  593.   '
  594.   If Err = 32755 Then
  595.     sgErrorMessage = "No Source File was Selected"
  596.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - M_FileOpen"
  597.     Resume Next
  598.   End If
  599.   '
  600.   If Err = 5 Then
  601.     sgErrorMessage = "ERROR 5: Illegal Function Call" & " - M_FileOpen"
  602.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName
  603.     Resume Next
  604.   End If
  605.   '
  606.   If Err = 7 Then
  607.     sgErrorMessage = "Out of Memory"
  608.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - M_FileOpen"
  609.     Resume Next
  610.   End If
  611.   '
  612.   Select Case Err
  613.     Case 0: Exit Sub
  614.     Case 53: sgErrorMessage = "ERROR 53: That file doesn't exist."
  615.     Case 62: sgErrorMessage = "ERROR 62: Attempt to Input past End-of-File."
  616.     Case 68: sgErrorMessage = "ERROR 68: Drive " & Left$(smSourceFileName, 1) & ": not available."
  617.     Case 76: sgErrorMessage = "ERROR 76: That path doesn't exist."
  618.     Case Else: sgErrorMessage = "ERROR " & Err & " occurred." & "  " & Error$(Err)
  619.   End Select
  620.   MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - M_FileOpen"
  621.   Resume Next
  622.   '
  623.  
  624.   End Sub
  625.  
  626. '---------------------------------------------------------
  627. ' Process Menu 'File/Print' Selection Event
  628. '---------------------------------------------------------
  629. Sub M_FilePrint_Click ()
  630.   '
  631.   Dim lFileSize As Long
  632.   Dim sWork1 As String
  633.   Dim iWork1 As Integer
  634.   Dim iPageCounter As Integer
  635.   Dim iLineCounter As Integer
  636.   '
  637.   On Error GoTo ErrHandler
  638.   '
  639.   '' Specify Print Action
  640.   CMDialog1.CancelError = True
  641.   CMDialog1.Flags = PD_NOPAGENUMS
  642.   CMDialog1.DialogTitle = sgProgramName & " Print"
  643.     'TRIGGERS Print Dialog
  644.   CMDialog1.Action = DLG_PRINT
  645.   '
  646.   If igErrorNumber = 32755 Then
  647.     ' User cancelled Print Dialog
  648.     igErrorNumber = 0
  649.     Exit Sub
  650.   End If
  651.   '
  652.   lFileSize = FileLen(smSourceFileName)
  653.   '
  654.   If (CMDialog1.Flags And PD_PRINTTOFILE) > 0 Then
  655.     '' Specify Save File
  656.     CMDialog1.Flags = OFN_NOREADONLYRETURN Or OFN_PATHMUSTEXIST Or OFN_HIDEREADONLY Or OFN_OVERWRITEPROMPT
  657.     CMDialog1.DialogTitle = sgProgramName & " Print to File"
  658.     CMDialog1.InitDir = "C:\"
  659.     CMDialog1.Filename = sgProgramName & ".PRN"
  660.       'TRIGGERS Print-to-File
  661.     CMDialog1.Action = DLG_FILE_SAVE
  662.     '
  663.     If igErrorNumber = 32755 Then
  664.       ' User cancelled Print-to-File Dialog
  665.       igErrorNumber = 0
  666.       Exit Sub
  667.     End If
  668.     '
  669.     '' Open Save File
  670.     Open CMDialog1.Filename For Output As #2
  671.     ' Print to Save File
  672.     Form_Main.MousePointer = HOURGLASS
  673.     iPageCounter = 1
  674.     iLineCounter = 1
  675.     iWork1 = 0
  676.     Do Until Len(Form_Main.GrpDetail.List(iWork1)) < 1
  677.       If iLineCounter < 2 Then
  678.         Print #2, Tab(3); sgProgramName; " "; sgProgramVersion;
  679.         Print #2, Tab(49); Date$; " "; Time$;
  680.         Print #2, Tab(70); "Page "; iPageCounter
  681.         sWork1 = smSourceFileName & "  " & Format$(lFileSize, "###,###,##0") & " == " & Hex(lFileSize - 1)
  682.         Print #2, Tab(38 - (Len(sWork1) / 2)); sWork1
  683.         sWork1 = "(c)TecLogic,Inc. 1993  " & sgRegistrationStatus
  684.         Print #2, Tab(38 - (Len(sWork1) / 2)); sWork1
  685.         Print #2, Tab(3); "(c)TecLogic,Inc. 1993";
  686.         Print #2, Tab(30); sgRegistrationStatus
  687.         Print #2, " "
  688.         iLineCounter = 4
  689.       End If
  690.       If Mid$(Form_Main.GrpDetail.List(iWork1), 2, 1) = ":" Then
  691.         Print #2, " "
  692.         iLineCounter = iLineCounter + 1
  693.       End If
  694.       Print #2, Tab(5); Form_Main.GrpDetail.List(iWork1)
  695.       iLineCounter = iLineCounter + 1
  696.       iWork1 = iWork1 + 1
  697.       If iLineCounter > 52 Then
  698.         Print #2, Chr$(12);
  699.         iPageCounter = iPageCounter + 1
  700.         iLineCounter = 1
  701.       End If
  702.     Loop
  703.     Close #2
  704.     ' Save File is Complete
  705.   Else
  706.     ' Print to Printer
  707.     Form_Main.MousePointer = HOURGLASS
  708.     iPageCounter = 1
  709.     iLineCounter = 1
  710.     iWork1 = 0
  711.     Do Until Len(Form_Main.GrpDetail.List(iWork1)) < 1
  712.       If iLineCounter < 2 Then
  713.         Printer.Print Tab(3); sgProgramName; " "; sgProgramVersion;
  714.         Printer.Print Tab(49); Date$; " "; Time$;
  715.         Printer.Print Tab(70); "Page "; iPageCounter
  716.         sWork1 = smSourceFileName & "  " & Format$(lFileSize, "###,###,##0") & " == " & Hex(lFileSize - 1)
  717.         Printer.Print Tab(38 - (Len(sWork1) / 2)); sWork1
  718.         sWork1 = "(c)TecLogic,Inc. 1993  " & sgRegistrationStatus
  719.         Printer.Print Tab(38 - (Len(sWork1) / 2)); sWork1
  720.         Printer.Print " "
  721.         iLineCounter = 4
  722.       End If
  723.       If Mid$(Form_Main.GrpDetail.List(iWork1), 2, 1) = ":" Then
  724.         Printer.Print " "
  725.         iLineCounter = iLineCounter + 1
  726.       End If
  727.       Printer.Print Tab(5); Form_Main.GrpDetail.List(iWork1)
  728.       iLineCounter = iLineCounter + 1
  729.       iWork1 = iWork1 + 1
  730.       If iLineCounter > 52 Then
  731.         Printer.NewPage
  732.         iPageCounter = iPageCounter + 1
  733.         iLineCounter = 1
  734.       End If
  735.     Loop
  736.     Printer.EndDoc
  737.     ' Print to Printer is Complete
  738.   End If
  739.   '
  740.   Form_Main.MousePointer = DEFAULT
  741.   '
  742.   Exit Sub
  743. '
  744. ErrHandler:
  745.   '
  746.   igErrorNumber = Err
  747.   '
  748.   ' User cancelled Dialog
  749.   If Err = 32755 Then
  750.     Resume Next
  751.   End If
  752.   '
  753.   If Err = 5 Then
  754.     sgErrorMessage = "ERROR 5: Illegal Function Call"
  755.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - M_FilePrint"
  756.     Resume Next
  757.   End If
  758.   '
  759.   If Err = 7 Then
  760.     sgErrorMessage = "Out of Memory"
  761.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - M_FilePrint"
  762.     Resume Next
  763.   End If
  764.   '
  765.   Select Case Err
  766.     Case 0: Exit Sub
  767.     Case 53: sgErrorMessage = "ERROR 53: That file doesn't exist."
  768.     Case 62: sgErrorMessage = "ERROR 62: Attempt to Input past End-of-File."
  769.     Case 68: sgErrorMessage = "ERROR 68: Drive " & Left$(smSourceFileName, 1) & ": not available."
  770.     Case 76: sgErrorMessage = "ERROR 76: That path doesn't exist."
  771.     Case Else: sgErrorMessage = "ERROR " & Err & " occurred." & "  " & Error$(Err)
  772.   End Select
  773.   MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - M_FilePrint"
  774.   Resume Next
  775.   '
  776.  
  777. End Sub
  778.  
  779. '---------------------------------------------------------
  780. ' Process Menu 'Help/About' Selection Event
  781. '---------------------------------------------------------
  782. Sub M_HelpAbout_Click ()
  783.   '
  784.   Form_About.Enabled = True
  785.   Form_Main.Visible = False
  786.   Form_About.Visible = True
  787.  
  788. End Sub
  789.  
  790. '--------------------------------------------------------
  791. ' Read back formatted dump records by line, skipping records
  792. '  between iRecordCount and iStartRecord and reading from
  793. '  and displaying, in the ListBox, from iStartRecord until
  794. '  Error #7 (out of memory) occurs.
  795. '--------------------------------------------------------
  796. Sub ReadBack (sSourceFileName As String, iStartRecord As Integer, iMaxRecord As Integer, iEndOfFileFlag As Integer, sBuffer As String)
  797.   '
  798.   Dim iRecordCount As Integer
  799.   '
  800.   igErrorNumber = 0
  801.   On Error GoTo ReadBackError
  802.   '
  803.   If iEndOfFileFlag = False Then
  804.     '
  805.     ' Open the Work File
  806.     Open sSourceFileName For Input As #1
  807.     iRecordCount = 0
  808.     '
  809.     ' Skip Prior Records
  810.     While iRecordCount < iStartRecord
  811.       Input #1, sBuffer
  812.       iRecordCount = iRecordCount + 1
  813.     Wend
  814.     '
  815.     ' Read and Display Formatted Lines
  816.     While iRecordCount < iMaxRecord And igErrorNumber = 0
  817.       Input #1, sBuffer
  818.       GrpDetail.AddItem sBuffer
  819.       If igErrorNumber = 0 Then
  820.         iRecordCount = iRecordCount + 1
  821.       End If
  822.     Wend
  823.     '
  824.     If igErrorNumber = 0 Then iEndOfFileFlag = True
  825.     '
  826.     Close #1
  827.   '
  828.   End If
  829.   '
  830.   On Error GoTo 0
  831.   '
  832.   Exit Sub
  833. '
  834. '
  835. ReadBackError:
  836.   '
  837.   igErrorNumber = Err
  838.   '
  839.   If Err = 5 Then
  840.     sgErrorMessage = "ERROR 5: Illegal Function Call"
  841.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - ReadBack"
  842.     Resume Next
  843.   End If
  844.   '
  845.   If Err = 7 Then
  846.     Resume Next
  847.   End If
  848.   '
  849.   Select Case Err
  850.     Case 0: Exit Sub
  851.     Case 53: sgErrorMessage = "ERROR 53: That file doesn't exist."
  852.     Case 62: sgErrorMessage = "ERROR 62: Attempt to Input past End-of-File."
  853.     Case 68: sgErrorMessage = "ERROR 68: Drive " & Left$(smSourceFileName, 1) & ": not available."
  854.     Case 76: sgErrorMessage = "ERROR 76: That path doesn't exist."
  855.     Case Else: sgErrorMessage = "ERROR " & Err & " occurred." & "  " & Error$(Err)
  856.   End Select
  857.   MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - ReadBack"
  858.   Resume Next
  859.   '
  860.  
  861. End Sub
  862.  
  863. '--------------------------------------------------------
  864. ' Read a block, from the input file, from lOffset.
  865. '  Adjust the size of sBuffer and set iEndOfFileFlag
  866. '  when a short record is read.
  867. '--------------------------------------------------------
  868. Sub ReadBlock (sSourceFileName As String, lFileSize As Long, iEndOfFileFlag As Integer, lOffset As Long, sBuffer As String)
  869.   '
  870.   On Error GoTo ReadBlockError
  871.   '
  872.   If iEndOfFileFlag = False Then
  873.     '
  874.     ' Open the Input File as Binary
  875.     Open sSourceFileName For Binary Access Read As #1
  876.     '
  877.     ' Read a Block of Data
  878.     sBuffer = String$(BLOCK_SIZE, " ")
  879.     Get #1, lOffset + 1, sBuffer
  880.     '
  881.     Close #1
  882.     '
  883.     If Len(sBuffer) < BLOCK_SIZE Then iEndOfFileFlag = True
  884.     If lOffset + Len(sBuffer) >= lFileSize Then
  885.       iEndOfFileFlag = True
  886.       sBuffer = Left$(sBuffer, lFileSize - lOffset)
  887.     End If
  888.     '
  889.   End If
  890.   '
  891.   On Error GoTo 0
  892.   '
  893.   Exit Sub
  894. '
  895. '
  896. ReadBlockError:
  897.   '
  898.   igErrorNumber = Err
  899.   '
  900.   If Err = 5 Then
  901.     sgErrorMessage = "ERROR 5: Illegal Function Call"
  902.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - ReadBlock"
  903.     Resume Next
  904.   End If
  905.   '
  906.   If Err = 7 Then
  907.     sgErrorMessage = "Out of Memory"
  908.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - ReadBlock"
  909.     Resume Next
  910.   End If
  911.   '
  912.   Select Case Err
  913.     Case 0: Exit Sub
  914.     Case 53: sgErrorMessage = "ERROR 53: That file doesn't exist."
  915.     Case 62: sgErrorMessage = "ERROR 62: Attempt to Input past End-of-File."
  916.     Case 68: sgErrorMessage = "ERROR 68: Drive " & Left$(smSourceFileName, 1) & ": not available."
  917.     Case 76: sgErrorMessage = "ERROR 76: That path doesn't exist."
  918.     Case Else: sgErrorMessage = "ERROR " & Err & " occurred." & "  " & Error$(Err)
  919.   End Select
  920.   MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - ReadBlock"
  921.   Resume Next
  922.   '
  923.  
  924. End Sub
  925.  
  926. '--------------------------------------------------------
  927. ' Save Private Profile Values
  928. '
  929. '   Uses: sgWindowsDirectory, sgProgramName, GrpDir.Path
  930. '
  931. '   Sets: none
  932. '
  933. '--------------------------------------------------------
  934. Sub Save_Private_Profile ()
  935.   '
  936.   Dim sIniFile As String
  937.   Dim fLeft, fTop, fWidth, fHeight As Single
  938.   '
  939.   sIniFile = sgWindowsDirectory
  940.   If Right$(sIniFile, 1) <> "\" Then
  941.     sIniFile = sIniFile & "\" & sgProgramName & ".INI"
  942.   Else sIniFile = sIniFile & sgProgramName & ".INI"
  943.   End If
  944.   '
  945.   '
  946.   fLeft = Form_Main.Left
  947.   fTop = Form_Main.Top
  948.   fWidth = Form_Main.Width
  949.   fHeight = Form_Main.Height
  950.   '
  951.   If fLeft < 2 Then fLeft = 5
  952.   If fTop < 2 Then fTop = 5
  953.   If fWidth > Screen.Width Then fWidth = Screen.Width - 45
  954.   If fHeight > Screen.Height Then fHeight = Screen.Height - 5
  955.   '
  956.   ' Write 'Window/Left'
  957.   Call WritePProfileString("Window", "Left", Str$(fLeft), sIniFile)
  958.   ' Write 'Window/Top'
  959.   Call WritePProfileString("Window", "Top", Str$(fTop), sIniFile)
  960.   ' Write 'Window/Width'
  961.   Call WritePProfileString("Window", "Width", Str$(fWidth), sIniFile)
  962.   ' Write 'Window/Height'
  963.   Call WritePProfileString("Window", "Height", Str$(fHeight), sIniFile)
  964.  
  965. End Sub
  966.  
  967. '--------------------------------------------------------
  968. ' Format the dump image of a block of data from sBuffer
  969. '  into Work File records, addressed starting from
  970. '  lBlockOffset.  Count Work File records into imMaxMaxRecord.
  971. '--------------------------------------------------------
  972. Sub WorkBlock (sWorkFileName As String, lBlockOffset As Long, sBuffer As String)
  973.   '
  974.   Dim sWork1, sWork2 As String
  975.   Dim iWork1, iWork2, iWork3 As Integer
  976.   '
  977.   ' Open a WORK file to hold the Dump output
  978.   On Error GoTo WorkBlockError
  979.   If lBlockOffset = 0 Then
  980.     Open sgWorkFileName For Output As #2
  981.   Else
  982.     Open sgWorkFileName For Append As #2
  983.   End If
  984.   '
  985.   ' Dump the full block
  986.   iWork1 = 0
  987.   While iWork1 < Len(sBuffer) And igErrorNumber = 0
  988.     '
  989.     ' Format the 5 Hex Digit Address followed by a space
  990.     sWork1 = Hex(lBlockOffset + iWork1)
  991.     If Len(sWork1) < 5 Then sWork1 = String$(5 - Len(sWork1), "0") & sWork1
  992.     sWork2 = sWork1 & " "
  993.     '
  994.     ' Format the 16 byte Hex area
  995.     iWork2 = 1
  996.     While iWork2 <= 16 And iWork1 + iWork2 <= Len(sBuffer)
  997.       sWork1 = Hex(Asc(Mid$(sBuffer, iWork1 + iWork2, 1)))
  998.       If Len(sWork1) < 2 Then sWork1 = String$(2 - Len(sWork1), "0") & sWork1
  999.       sWork2 = sWork2 & sWork1 & " "
  1000.       If iWork2 = 8 Then sWork2 = sWork2 & "- "
  1001.       iWork2 = iWork2 + 1
  1002.     Wend
  1003.     '
  1004.     ' Space-fill any unused Hex area
  1005.     sWork2 = sWork2 & String$(56 - Len(sWork2), " ")
  1006.     '
  1007.     ' Format the Ascii area Left Margin
  1008.     sWork2 = sWork2 & "|"
  1009.     '
  1010.     ' Format the 16 byte Ascii area
  1011.     iWork2 = 1
  1012.     While iWork2 <= 16 And iWork1 + iWork2 <= Len(sBuffer)
  1013.       iWork3 = Asc(Mid$(sBuffer, iWork1 + iWork2, 1))
  1014.       If iWork3 < 32 Or iWork3 > 126 Or iWork3 = 44 Then
  1015.         sWork1 = "."
  1016.       Else
  1017.         sWork1 = Chr$(iWork3)
  1018.       End If
  1019.       sWork2 = sWork2 & sWork1
  1020.       iWork2 = iWork2 + 1
  1021.     Wend
  1022.     '
  1023.     ' Format the Ascii area Right Margin
  1024.     sWork2 = sWork2 & "|"
  1025.     '
  1026.     ' Print the Formatted Line into the Work File
  1027.     Print #2, sWork2
  1028.     '
  1029.     ' Count the Formatted Lines
  1030.     imMaxRecord = imMaxRecord + 1
  1031.     '
  1032.     iWork1 = iWork1 + 16
  1033.   Wend
  1034.   '
  1035.   ' Close the Work File
  1036.   Close #2
  1037.   '
  1038.   On Error GoTo 0
  1039.   '
  1040. Exit Sub
  1041. '
  1042. '
  1043. WorkBlockError:
  1044.   '
  1045.   igErrorNumber = Err
  1046.   '
  1047.   If Err = 5 Then
  1048.     sgErrorMessage = "ERROR 5: Illegal Function Call"
  1049.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - DumpBlock"
  1050.     Resume Next
  1051.   End If
  1052.   '
  1053.   If Err = 7 Then
  1054.     sgErrorMessage = "Out of Memory!" & Chr$(10) & "What you can see should be good." & Chr$(10) & "This version can only handle a dump of about 14,100 bytes."
  1055.     MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - DumpBlock"
  1056.     Resume Next
  1057.   End If
  1058.   '
  1059.   Select Case Err
  1060.     Case 0: Exit Sub
  1061.     Case 53: sgErrorMessage = "ERROR 53: That file doesn't exist."
  1062.     Case 62: sgErrorMessage = "ERROR 62: Attempt to Input past End-of-File."
  1063.     Case 68: sgErrorMessage = "ERROR 68: Drive " & Left$(smSourceFileName, 1) & ": not available."
  1064.     Case 76: sgErrorMessage = "ERROR 76: That path doesn't exist."
  1065.     Case Else: sgErrorMessage = "ERROR " & Err & " occurred." & "  " & Error$(Err)
  1066.   End Select
  1067.   MsgBox sgErrorMessage, MB_ICONEXCLAMATION, sgProgramName & " - DumpBlock"
  1068.   Resume Next
  1069.   '
  1070. End Sub
  1071.  
  1072.